package Terminal.UI;

import java.awt.BorderLayout;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.swing.JFrame;
import javax.swing.JPanel;

import Terminal.Controller.CSession;
//import Server.UI.Intestazione;

public class TimeLoggingFrame extends JFrame{

	private static final long serialVersionUID = 5875400095285549752L;
	
	private static TimeLoggingFrame _instanza;

	public static TimeLoggingFrame instanza()
	{
		if (_instanza == null)
			_instanza = new TimeLoggingFrame();
		return _instanza;
	}


	private TimeLoggingFrame(){
		super("TimeLogging - Terminale");
		
		//questo di seguito aggiunto	/*	
		CSession session = CSession.instanza();				
		
		JPanel pannello = session.getGestoreInterfaccia().createInterfaccia();
		
		
		setVisible(true);
		
		setSize(1366,725);
		setLayout(null);
		getContentPane().add(pannello);//, BorderLayout.CENTER);

		addWindowListener( new WindowAdapter() 
		{
			public void windowClosing(WindowEvent e) 
			{
				System.exit(0);
			}
		});
		
		/*validate();		
		repaint();//*/
	}
	
	public void refrash(){
		System.out.print("\n"+getContentPane());
		getContentPane().removeAll();
		CSession session = CSession.instanza();			
		JPanel pannello = session.getGestoreInterfaccia().createInterfaccia();
		/*setSize(1366,725);
		setLayout(null);*/
		getContentPane().add(pannello);
		validate();
		repaint();

	}

}
